package com.javabasic.spring.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.stereotype.Component;

/**
 * @author: 晓帆
 * @description:
 * @create: 2021-06-28 10:26
 **/
@Component
public class CustomAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("hello");
        Object proceed = methodInvocation.proceed();//执行委托类方法
        System.out.println("world");
        return proceed;
    }
}
